use cosmwasm_std::{HumanAddr, Uint128};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use crate::pool::PoolInfo;

#[derive(Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct InstantiateMsg {
    /// Owner if none set to info.sender.
    pub owner: Option<HumanAddr>,
    pub reward_per_block: Uint128,
    pub all_points: u64,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    AddPool {
        pool: PoolInfo,
    },
    UpdateConfig {
        new_owner: HumanAddr,
        reward_per_block: Uint128,
    },
    Deposit {
        pool_id: u8,
        nfttoken_id: String,
    },
    ClaimReward {
        pool_id: u8,
    },
    Unstake {
        nfttoken_id: String,
        pool_id: u8,
    },
    WithdrawReward {
        pool_id: u8,
    },
    WithdrawStake {
        pool_id: u8,
        nfttoken_id: String,
    }
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum Action {
    Deposit(String),
    WithDraw(String),
    ClaimReward(String),
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Config {},
    Pool {
        pool_id: u8,
    },
    Pools {},
    Staker {
        address: HumanAddr,
        block_time: u64,
        pool_id: u8,
    },
}
